package com.lsongh.springboot2.service;

import com.lsongh.springboot2.entity.Culture;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CultrueService extends JpaRepository<Culture,Integer> {

    @Query("select a from Culture a  where a.cultrueDelete = ?1 order by a.cultureId desc ")
    List<Culture> findAllCultrue(Integer isDelete);


    @Query("select a from Culture a  where a.cultrueDelete = ?1 and a.cultureName  like concat('%' ,?2 , '%')  order by a.cultureId desc ")
    List<Culture> findAllCultrueByName(Integer isDelete,String name);
}
